package pl.perseus.action;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import lombok.Getter;
import lombok.Setter;
import pl.perseus.model.enums.Time;

public class GetTimeAction extends BaseAction {

	@Getter
	@Setter
	Map<String, Object> result;
	
	@Override
	public String execute() {
		result = new HashMap<String, Object>();
		List<Map<String, String>> items = new LinkedList<Map<String, String>>();
		for(Time t : Time.values()){
			Map<String, String> timeMap = new HashMap<String, String>();
			timeMap.put("id", t.getTime());
			timeMap.put("name", t.getTime());
			
			items.add(timeMap);
		}
		
		result.put("identifier", "id");
		result.put("items", items);
		
		return SUCCESS;
	}

}
